﻿using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using POS.BusinessComponents;
using POS.BusinessEntities;
using POS.DataObjects;
using Rhino.Mocks;

namespace POS.BusinessComponentsTest
{
    [TestClass]
    public class BCEstacionTest
    {
        #region Declarations

        private readonly MockRepository mocks = new MockRepository();
        private const int EmpresaId = 1;
        private const int SucursalId = 1;

        #endregion

        #region Test Methods

        [TestMethod]
        public void GetEstacionList()
        {
            var dummyFilter = "dummy";
            var doMock = (DOEstacion)mocks.StrictMock(typeof(DOEstacion));
            var expected = new List<BEEstacion>();

            Expect.Call(doMock.GetList(EmpresaId, SucursalId, dummyFilter)).Return(expected).Repeat.Once();

            doMock.Replay();
            new BCEstacion(doMock).GetList(dummyFilter);
            doMock.VerifyAllExpectations();
        }

        [TestMethod]
        public void SaveEstacion()
        {
            var dummyEntity = new BEEstacion();
            var user = "testUser";

            var doMock = (DOEstacion)mocks.StrictMock(typeof(DOEstacion));
            doMock.Save(dummyEntity, EmpresaId, SucursalId, user);
            LastCall.IgnoreArguments();
            mocks.ReplayAll();
            new BCEstacion(doMock).Save(dummyEntity);
            mocks.VerifyAll();
        }

        #endregion
    }
}
